/*
 * FunctionEvaluationSource.java - ScriptME
 * 
 * Copyright (c) 2009 Cesar Henriques <cesar at alttab.com.ar>.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Based on FESI Project
 * 
 * Contributors:
 * 	Jean-Marc Lugrin - initial API and implementation
 * 	Cesar Henriques <cesar at alttab.com.ar> - J2ME Porting and Extensions
 */
package org.scriptme.ecmascript.interpreter;

/**
 * Describe a function used as a source.
 */
public class FunctionEvaluationSource extends EvaluationSource {

	/** The function name. */
	private String theFunctionName;

	/**
	 * Create a function source description.
	 * 
	 * @param evaluationSource
	 *            Describe the function name
	 * @param theFunctionName
	 *            the the function name
	 */
	public FunctionEvaluationSource(EvaluationSource evaluationSource,
			String theFunctionName) {
		super(evaluationSource);
		this.theFunctionName = theFunctionName;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.scriptme.ecmascript.interpreter.EvaluationSource#getEvaluationSourceText()
	 */
	protected String getEvaluationSourceText() {
		return "of function '" + theFunctionName + "' "
				+ previousSource.getEvaluationSourceText();
	}
}
